﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Meraz.Core.Model;
using Meraz.Core.Repositories;
using Ninject;

namespace Meraz.Core.Managers
{
    public class BlogManager
    {
        [Inject]
        public IBlogStudyRepository BlogStudyRepository{ get; set; }

        [Inject]
        public IAliasRepository AliasRepository { get; set; }

        [Inject]
        public IBlogRepository BlogRepository{ get; set; }

        public IEnumerable<Alias> GetAliases(string blogName)
        {
            return AliasRepository.GetBlogAliases(blogName);
        }

        public BlogStudy GetStudy(int studyID)
        {
            return BlogStudyRepository.GetById(studyID);
        }

        public List<BlogStudy> GetStudies()
        {
            return BlogStudyRepository.All();
        }

        public IEnumerable<Blog> GetBlogsInStudy(int studyID)
        {
            return BlogStudyRepository.GetById(studyID).Blogs;
        }
    }
}
